8b9585f595eff7f9edbc05fe4b50329778c8deb5,src/main/java/org/jboss/remoting3/jmx/protocol/v1/ServerProxy.java,GetAttributeHandler,handle,#DataInput#number#,445
Before Change
String attribute = unmarshaller.readUTF();
DataOutputStream dos = null;
try {
Object attributeValue = server.getMBeanServer().getAttribute(objectName, attribute);
dos = new DataOutputStream(channel.writeMessage());
dos.writeByte(GET_ATTRIBUTE ^ RESPONSE_MASK);
dos.writeInt(correlationId);
dos.writeByte(SUCCESS);
dos.writeByte(OBJECT);
Marshaller marshaller = prepareForMarshalling(dos);
marshaller.writeObject(attributeValue);
marshaller.finish();
log.tracef("[%d] GetAttribute - Success Response Sent", correlationId);
} catch (Exception e) {
dos = new DataOutputStream(channel.writeMessage());
dos.writeByte(GET_ATTRIBUTE ^ RESPONSE_MASK);
dos.writeInt(correlationId);
dos.writeByte(FAILURE);
dos.writeByte(EXCEPTION);
if (e instanceof RuntimeException) {
// We only want to send back the known checked exceptions.
log.error(e);
e = new IOException("Unexpected internal failure.");
}
Marshaller marshaller = prepareForMarshalling(dos);
marshaller.writeObject(e);
marshaller.finish();
log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId);
} finally {
IoUtils.safeClose(dos);
}
After Change
}
String attribute = unmarshaller.readUTF();
try {
final Object attributeValue = server.getMBeanServer().getAttribute(objectName, attribute);
writeResponse(attributeValue, OBJECT, GET_ATTRIBUTE, correlationId);
log.tracef("[%d] GetAttribute - Success Response Sent", correlationId);
} catch (AttributeNotFoundException e) {
writeResponse(e, GET_ATTRIBUTE, correlationId);
log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId);
} catch (InstanceNotFoundException e) {
writeResponse(e, GET_ATTRIBUTE, correlationId);
log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId);
} catch (MBeanException e) {
writeResponse(e, GET_ATTRIBUTE, correlationId);
log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId);
} catch (ReflectionException e) {
writeResponse(e, GET_ATTRIBUTE, correlationId);
log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId);
}
}
}